<?php


namespace app\admin\validates;


use think\Validate;

class PractiseSubjectValidate extends Validate
{
    /**
     * 验证规则
     * @var array
     */
    protected $rule = [
        'id' => 'require|number',
        'name' => 'chsDash|max:30',
        'sort' => 'number',
        'list' => 'require|array',
        'title'=>'require',
        'degree'=>'require|number',
        'practise_id'=>'require|number',
        'type'=>'require|number',
        'subject_id'=>'require|number',
        'analysis'=>'require',
        'analysis_desc'=>'max:255',
        'content'=>'require',
    ];

    /**
     * 验证字段描述
     * @var string[]
     */
    protected $field = [
        'id' => 'ID',
        'title'=>'题目名称',
        'degree'=>'难度',
        'practise_id'=>'练习',
        'type'=>'题目类型',
        'subject_id'=>'原题目',
        'analysis'=>'答案',
        'analysis_desc'=>'题目简介',
        'content'=>'内容',
    ];

    /**
     * 验证场景
     * @var array
     */
    protected $scene = [
        'add' => ['title', 'sort'],
        'edit' => ['id', 'title', 'sort', 'degree', 'subject_id', 'analysis_desc','content'],
        'del' => ['id'],
        'create' => ['list'],
        'details' => ['id']
    ];
}